<template lang="html">
  <div class="help-details">
    <div class="help-details-container">
      <div class="help-details-container__title">
        <span>{{details.problem}}</span>
      </div>
      <div class="help-details-container__content">
        <span>{{details.answer}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant'
export default {
  data () {
    return {
      id: this.$route.params.id,
      details: {}
    }
  },
  created () {
    this.getHelpDetails()
  },
  methods: {
    getHelpDetails () {
      this.$Axios.get('help_problem?status=1&id=' + this.id).then((response) => {
        Toast.clear()
        if (response.return_code === '0000') {
          if (response.data.list.length !== 0) {
            this.details = response.data.list[0]
          }
        } else {
          Toast(response.return_msg)
        }
      }).catch((error) => {
        console.log(error)
        Toast.clear()
        Toast('请求响应失败')
      })
    }
  }
}
</script>

<style lang="css" scoped>
</style>
